@extends('admin.layouts.layout')
@section('content')
<div class="row">
    <div class="col-sm-12">
        <div class="ibox-title">
            <h5>账单明细</h5>
        </div>
            <div class="ibox-content" style="display: block;">
                <form role="form" class="form-inline">
                    <div class="form-group" id="layer_date">                   
						<span style="margin-right: 15px;"><a class="menuid btn btn-primary btn-sm" href="{{route('finance.index',$id)}}"><i class="fa fa-undo" aria-hidden="true"></i> 返回财务公司管理</a>	</span>					
                        <label for="exampleInputEmail2" class="control-label">起止时间</label>
						<input id="start" name="start" class="laydate-icon form-control layer-date" >
                        <label for="exampleInputEmail2" class="control-label">截止时间</label>
						<input id="end" name="end" class="laydate-icon form-control layer-date">
                            <button type="submit" class="menuid btn btn-primary btn-sm">搜索</button>
                    </div>
					<a class="menuid btn btn-primary btn-sm" href="{{ route('bill.finance',0)}}">账单下载</a>                    
                </form>
            </div>
                  
        <div class="ibox-content">
                <table class="table table-striped table-bordered table-hover m-t-md">
                    <thead>
                    <tr>
                        <th class="text-left" width="100">类别</th>
                        <th class="text-left" width="100">时间</th>
                        <th class="text-left" width="150">金豆</th>
                        <th class="text-left" width="100">来源</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($bills as $key=>$item) 
                        <tr>
                            <td class="text-left">{{$item->consume_category}}</td>
                            <td class="text-left">{{$item->operate_time}}</td>
                            <td class="text-left">{{intval($item->consume_amount)}}</td>
                            <td class="text-left">{{$item->operate_description}}</td>
                        </tr>
                    @endforeach()
                    </tbody>
                </table>
            <div class="pull-right pagination m-t-no">
                <div class="text-center">
                    {{$bills->links()}}
                </div>
                <div>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>
<script src="{{loadEdition('/js/plugins/layer/laydate/laydate.js')}}"></script>
<script>
    laydate({elem: "#layer_date", event: "focus"});
    laydate.skin('molv');
    var start = {
        elem: "#start",
        format: "YYYY-MM-DD",
        min: '1900-01-01 00:00:00',//laydate.now(),
        max: "2099-06-16 23:59:59",
        istime: false,
        istoday: false,
        choose: function (datas) {
            end.min = datas;
            end.start = datas
        }
    };
    var end = {
        elem: "#end",
        format: "YYYY-MM-DD",
        min: '1900-01-01 00:00:00',//laydate.now(),
        max: "2099-06-16 23:59:59",
        istime: false,       
        istoday: true,
        range: true,
        choose: function (datas) {
            start.max = datas
        }
    };
    laydate(start);
    laydate(end);
</script>
@endsection